home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / bin / partman-commit < prev    next >
Text File  |  2008-10-14  |  2KB  |  101 lines

  1. #!/bin/sh
  2. set -e
  3.  
  4. . /lib/partman/lib/base.sh
  5.  
  6. cleanup () {
  7.     if [ -f /var/run/parted_server.pid ]; then
  8.         stop_parted_server
  9.     fi
  10. }
  11. trap cleanup EXIT
  12.  
  13. db_capb backup
  14.  
  15. ###########################################################
  16. # Compute some constants in order to make things faster.
  17. ###########################################################
  18.  
  19. # The width of partman/text/number.
  20. # number_width is used only in visual.d/number
  21. db_metaget partman/text/number description
  22. RET=$(printf "$RET" '')
  23. RET=$(stralign 50 "$RET" | sed 's/[^ ]//g')
  24. number_width=$((2 + 50 - ${#RET}))
  25. export number_width
  26.  
  27. # Detect if Debconf can escape strings
  28. # non-empty means we can escape
  29. can_escape=''
  30. if type debconf-escape >/dev/null 2>&1; then
  31.     db_capb backup
  32.     for cap in $RET; do
  33.         case $cap in
  34.             escape)    can_escape=yes ;;
  35.         esac
  36.     done
  37. fi
  38. export can_escape
  39.  
  40. # The decimal separator (dot or comma)
  41. #db_metaget partman/text/deci description
  42. #deci="$RET"
  43. # The comma has special meaning for debconf.  Lets force dot until we
  44. # start using escaped strings.
  45. deci='.'
  46. export deci
  47.  
  48. # work around bug #243373
  49. if [ "$TERM" = xterm ] || [ "$TERM" = bterm ]; then
  50.     debconf_select_lead="$NBSP"
  51. else
  52.     debconf_select_lead="> "
  53. fi
  54. export debconf_select_lead
  55.  
  56. ###########################################################
  57.  
  58.  
  59. initcount=`ls /lib/partman/init.d/* | wc -l`
  60. db_progress START 0 $initcount partman/progress/init/title
  61. for s in /lib/partman/init.d/*; do
  62.     if [ -x $s ]; then
  63.         base=$(basename $s | sed 's/[0-9]*//')
  64.         # Not every init script has, or needs, its own progress
  65.         # template. Add them to slow init scripts only.
  66.         if ! db_progress INFO partman/progress/init/$base; then
  67.             db_progress INFO partman/progress/init/fallback
  68.         fi
  69.         if ! $s; then
  70.             db_progress STOP
  71.             exit 10
  72.         fi
  73.     fi
  74.     db_progress STEP 1
  75. done
  76. db_progress STOP
  77.  
  78. # display.d intentionally omitted.
  79.  
  80. if [ -z "$PARTMAN_ALREADY_CHECKED" ]; then
  81.     for s in /lib/partman/check.d/*; do
  82.         if [ -x $s ]; then
  83.             $s
  84.         fi
  85.     done
  86. fi
  87.  
  88. for s in /lib/partman/commit.d/*; do
  89.     if [ -x $s ]; then
  90.         $s
  91.     fi
  92. done
  93.  
  94. for s in /lib/partman/finish.d/*; do
  95.     if [ -x $s ]; then
  96.         $s
  97.     fi
  98. done
  99.  
  100. exit 0
  101.